#include <stdio.h>
#include <string.h>

#define HELP "readme.txt"

typedef enum {
    false,
    true
} bool;

void showhelp();

int main(int argc, char *argv[])
{
    char cmd[200];
    bool eof = false;
    while(!eof){
        printf("cy> ");
        scanf("%s", cmd);
        if(strcmp(cmd, "quit") == 0 || strcmp(cmd, "q") == 0 || strcmp(cmd, "Q") == 0)
            eof = true;
        if(strcmp(cmd, "help") == 0)
            showhelp();
    }

    return 0;
}

void showhelp()
{
    char ch;
    FILE *fp = fopen(HELP, "r");
    if(fp == NULL)
    {
        printf("failed to open help file.\n");
        return;
    }
    while((ch = fgetc(fp)) != EOF) 
        printf("%c", ch);
    
    fclose(fp);
}
